﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gunningine
{
    using System.IO;

    public class TextLoader : IResourceLoader
    {
        #region IResourceLoader implementation.

        public string Name
        {
            get { return "Text"; }
        }

        public string[] SupportedFormats
        {
            get { return new string[] { ".txt", ".frag", ".vert", ".bs", ".boo" }; }
        }

        /// <summary>
        /// Load text into memory.
        /// </summary>
        public void Load(Resource res)
        {
            TextResource textResource = (TextResource)res;
            textResource.Text = File.ReadAllText(textResource.Filename);
        }

        #endregion
    }
}
